<!--{include header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="recent-deals">
	 <div id="content" class="clear mainwide">
        <div class="box">
            <div class="box-top"></div>
			<div class="box-content">
				<div class="head">
					<h2>
						特惠地图
					</h2>
				</div>
				<div class="sect" id="map_sect">
					<div id="map_canvas" class="shop-map"></div>
					<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
					<script type="text/javascript">
						function mapInit(){
							var myLatlng = new google.maps.LatLng({$city['latitude']}, {$city['longitude']});
							var myOptions = {
								zoom: 11,
								center: myLatlng,
								mapTypeId: google.maps.MapTypeId.ROADMAP
							};
							var myMap = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
							// Add marker
							<!--{loop $teams $index $one}-->
							var myMarker = new google.maps.Marker({
								position: new google.maps.LatLng({$one['partner']['latitude']}, {$one['partner']['longitude']}),
								title:"{$one['title']}",
								map: myMap,
								flat: true
							});
							var myMessage = "<div class=\"product-list\">"
											+	"<h3>"
											+		"<a href=\"../team.php?id={$one['id']}\" title=\"{$one['partner']}\" target=\"_blank\" class=\"site\">"
											+			"{$one['partner']['title']}"
											+		"</a></br>"
											+		"<a href=\"../team.php?id={$one['id']}\" title=\"{$one['title']}\" target=\"_blank\" class=\"title\">"
											+			"{$one['title']}"
											+		"</a>"
											+	"</h3>"
											+	"<div class=\"img\">"
											+		"<!--{if floor((time()-$one['begin_time'])/(3600*24)) == 0}-->"
											+		"<div class=\"new\">"
											+		"</div>"
											+		"<!--{elseif $one['now_number'] > 100}-->"
											+		"<div class=\"hot\">"
											+		"</div>"
											+		"<!--{/if}-->"
											+		"<div class=\"ad\">"
											+			"<a href=\"../team.php?id={$one['id']}\" title=\"立刻获取优惠券\" target=\"_blank\">"
											+				"<img  alt=\"{$one['title']}\" src=\"${team_image($one['image'])}\" width=\"270\" height=\"160\">"
											+			"</a>"
											+		"</div>"
											+		"<div class=\"count-down\" style=\"display:none;\">"
											+		"</div>"
											+		"<div class=\"time countdowner\" countdown=\"${$one['end_time']-time()}\" beforetoday=\"0\" style=\"display:none;\">"
											+			"距本券过期，还有"
											+			"<!--{if floor(($one['end_time']-time())/(3600*24)) > 0}-->"
											+			"<span class=\"red\">"
											+				"${floor(($one['end_time']-time())/(3600*24))}"
											+			"</span>"
											+			"天"
											+			"<span class=\"red\">"
											+				"${floor((($one['end_time']-time())%(3600*24))/3600)}"
											+			"</span>"
											+			"小时"
											+			"<span class=\"red\">"
											+				"${floor((($one['end_time']-time())%(3600*24)%3600)/60)}"
											+			"</span>"
											+			"分"
											+			"<!--{else}-->"
											+			"<span class=\"red\">"
											+				"${floor((($one['end_time']-time())%(3600*24))/3600)}"
											+			"</span>"
											+			"小时"
											+			"<span class=\"red\">"
											+				"${floor((($one['end_time']-time())%(3600*24)%3600)/60)}"
											+			"</span>"
											+			"分"
											+			"<span class=\"red\">"
											+				"${(($one['end_time']-time())%(3600*24)%3600)%60}"
											+			"</span>"
											+			"秒"
											+			"<!--{/if}-->"
											+		"</div>"
											+	"</div>"
											+	"<div class=\"address\">"
											+		"<span class=\"purchase\">"
											+			"<b>"
											+				"<strong class=\"count\">{$one['now_number']}</strong>"
											+			"</b>"
											+			"人已获取"
											+		"</span>"
											+		"<span class=\"discount\">"
											+			"<!--{if $one['discount_rate'] < $one['max_discount']}-->专享<!--{/if}-->{$one['discount_rate']}折"
											+		"</span>"
											+		"<span class=\"address\">"
											+			"{$one['address']}"
											+		"</span>"
											+	"</div>"
											+	"<div class=\"rebate\">"
											+		"<span class=\"iocn\">"
											+			"<a href=\"../team.php?id={$one['id']}\" title=\"立刻获取优惠券\" target=\"_blank\" class=\"gotosee\">"
											+			"</a>"
											+		"</span>"
											+		"<span class=\"price\">"
											+			"优惠区间：{$one['min_discount']} 至 {$one['max_discount']}折"
											+		"</span>"
											+	"</div>"
											+"</div>";
							attachMessage(myMap, myMarker, myMessage);
							<!--{/loop}-->
						}
						// Add message box
						function attachMessage(map, marker, message){
							var infowindow = new google.maps.InfoWindow({
								content: message,
								size: new google.maps.Size(50, 50)
							});
							google.maps.event.addListener(marker, 'click', function(){infowindow.open(map, marker);});
						}
						// 加载执行
						try {
							window.attachEvent("onload", mapInit);
						} catch(e) {
							window.addEventListener("load", mapInit, false);
						}
					</script>
				</div>
			</div>
            <div class="box-bottom"></div>
        </div>
    </div>
	<div id="sidebar">
		<!--{include block_side_network_weight}-->
		<!--{include block_side_subscribe}-->
	</div>
</div>
    </div> <!-- bd end -->
</div> <!-- bdw end -->

<!--{include footer}-->
